derivative method of first principle